unit UntFrmPadrao;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TFrmPadrao = class(TForm)
    procedure FormKeyPress(Sender: TObject; var Key: Char);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  private
    FpedirSair: Boolean;
  public
    property pedirSair: Boolean read FpedirSair write FpedirSair;
  end;


implementation

{$R *.dfm}

procedure TFrmPadrao.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

procedure TFrmPadrao.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
  if FpedirSair and (not )  then CanClose := False;
end;

procedure TFrmPadrao.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then begin
    Key := #0;

  end else if Key = #27 then begin
    Key := #0;
    Close;
  end;
end;

end.
